﻿<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>小程序网站</title>
</head>
<link href="/css/news.css" rel="stylesheet" />
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
<script src="/Scripts/jquery.js"></script>
<script src="/plugins/layer/layer.js"></script>
<script src="/Scripts/com.js"></script>
<script src="/Scripts/config.js"></script>
<script src="/Scripts/contact.js"></script>
<body style="padding:0px;margin:0px;">
    <div class="header">
        <div class="header-mid">
            <div class="header-mid-lft">
                <img src="/images/1loog.png" alt="" class="sitelogo title hide">
            </div>
            <div class="header-mid-rgt">
                <div class="phone-number" style="width:200px;margin-top:27px;color:gray;margin-right: 14px;font-family: SimHei,微软雅黑">服务热线：<span class="store-phone">400-600-9138</span></div>
                <!--<div class="header-input">
                    <input class="header-input_ip" type="text" name="" value="" placeholder="全站搜索">
                    <img src="/images/2.png" alt="" class="input-img">
                </div>-->

            </div>
        </div>
    </div>
    <!--导航-->
    <div class="navbar">
        <div class="navbar-rel pc_index_nav">
            <div class="navbar-rel-item" style="margin-left:20px;" onClick="location.href='index.html'">
                <span>首页</span>
            </div>
        </div>
    </div>

    <div class="classictitle">
        <div class="classictitle-lft">
            <div class="classictitle-lft-lft">
                典型案例
            </div>
            <div class="classictitle-lft-rgt">

            </div>
        </div>
        <div class="classictitle-rgt">
            <!--标题-->
            <div class="classictitle-rgt-lft"><span style="margin-left:20px;color:#898989;font-size: 14px;">首页/<span class="news-type"></span></span></div>
            <div class="classictitle-rgt-rgt">              
            </div>
        </div>
    </div>
    <div class="content">
        <div class="content-list">
            <div class="list">
                <!--分类-->
                <ul class="yiji"></ul>
            </div>
        </div>

        
        <div class="content-cont">
			<!--标题-->
			<div class="news-title" style="line-height: 50px;text-align: center;font-size: 18px;color: #ed7b09;margin-bottom:65px;">
			</div>
			<!--新闻内容-->
			<div style="margin-top: -50px;font-family:SimHei,'微软雅黑';font-size:18px;margin-left:-34px;" class="news-content"></div>
        </div>
    </div>
    <div id="contact" class="contact-back">
        <script language="javascript">
            contact();
        </script>
    </div>

    <script type="text/javascript">
        $(document).ready(function () {
            getStoreInfo();
            GetNavList(1);
            getNewsDetail();
        });

        var NewsTypeId = 0;
        function getNewsDetail() {
            var id = getQueryString("newsid");
            var url = siteUrl.fotmatUrl(siteUrl.NewsDetail.replace("{newsid}", id));
            AjaxGet(url, "", function (data) {
                if (!checkCode(data)) {
                    Alert(data.Message);    //显示错误消息
                    return;
                }
                if (!emptyData(data))
                    return; //显示空数据提示

                //var typeList = data.Data.NewsTypeList;
                //if (typeList != null) {
                //    var html = "";
                //    for (var i = 0; i < typeList.length; i++) {
                //        var item = typeList[i];
                //        var url = siteUrl.htmlUrl.NewsList.replace("{storeid}", storeInfo.storeId).replace("{linkid}", item.NewsTypeId);
                //        html += "<li><a href='" + url + "' class='inactive1' style='margin-top:0px;'>" + item.Name + "</a></li>";
                //    }
                //    $(".list .yiji").html(html);
                //}
                var item = data.Data.NewsInfo;
                if (item != null) {
                	NewsTypeId = item.NewsTypeId;
                	getNewsList();
                	$(".news-title").html(item.Title);
                	$(".news-content").html(item.Body);
                }
                
            });
        }


        function getNewsList() {        	
        	var url = siteUrl.fotmatUrl(siteUrl.NewsList.replace("{newstypeid}", NewsTypeId));
        	AjaxGet(url, "", function (data) {
        		if (!checkCode(data)) {
        			Alert(data.Message);    //显示错误消息
        			return;
        		}

        		if (!emptyData(data))
        			return; //显示空数据提示

        		if (data.Data.NewsTypeList != null)
        			loadNewsType(data.Data.NewsTypeList);
        	});
        }

        function loadNewsType(list) {
        	var html = "";
        	for (var i = 0; i < list.length; i++) {
        		var item = list[i];
        		html += "<li data-newsid='" + item.NewsTypeId + "'><a href='javascript:' class='inactive' style='margin-top:0px;'>" + item.Name + "</a></li>";
        		if (item.NewsTypeId == NewsTypeId) {
        			$(".news-type").html(item.Name);
        		}
        	}
        	$(".list .yiji").html(html);

        	$(".yiji li").click(function () {
        		var linkid = $(this).attr("data-newsid");
        		document.location.href = siteUrl.htmlUrl.NewsList.replace("{storeid}", storeInfo.storeId).replace("{linkid}", linkid);
        	})
        }
    </script>
</body>
</html>
